package com.ktwlsoft.archivemanage.domain.dao.repository.businessInspect;

import java.time.Year;
import java.util.HashMap;
import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.ktwlsoft.archivemanage.domain.dao.entity.businessInspect.BusinessInspect;
import com.ktwlsoft.archivemanage.payload.businessInspect.EfficiencyOfGuidanceAndMendOfPoint;
import com.ktwlsoft.archivemanage.payload.businessInspect.InspectEfficiencyPoint;
import com.ktwlsoft.archivemanage.payload.recycle.QueryRecycleRequest;
import com.ktwlsoft.archivemanage.payload.view.GuidanceVariation;
import com.ktwlsoft.archivemanage.payload.view.MarkLostResponse;
import com.ktwlsoft.archivemanage.payload.view.UnitMarkResponse;
import org.apache.ibatis.annotations.Mapper;

/**
 * business_inspect--业务检查
 *
 * @author zhuhe on 2019-11-12 15:00:45
 * @version 1.0
 */
@Mapper
public interface IBusinessInspectMapper {

    /**
     * 查询列表 on 2019-11-12 15:00:45
     *
     * @param businessInspect businessInspect
     * @return List<BusinessInspect>
     */
    List<BusinessInspect> findList(BusinessInspect businessInspect);

    /**
     * 查询列表 on 2019-11-12 15:00:45
     *
     * @param jsonObject jsonObject
     * @return List<BusinessInspect>
     */
    List<BusinessInspect> findListJson(JSONObject jsonObject);

    /**
     * 查询列表 on 2019-11-12 15:00:45
     *
     * @param jsonObject jsonObject
     * @return List<BusinessInspect>
     */
    List<JSONObject> selfOrRepeatFindListJson(JSONObject jsonObject);

    /**
     * 查询指导人
     */
    List<HashMap> findInstructors();

    /**
     * 根据id查询信息 on 2019-11-12 15:00:45
     *
     * @param id id
     * @return BusinessInspect
     */
    BusinessInspect getById(Long id);

    /**
     * 根据指导单号查询数据 on 2019/11/21 14:43
     *
     * @param guidanceNum guidanceNum
     * @return BusinessInspect
     */
    List<BusinessInspect> getByGuidanceNum(String guidanceNum);

    /**
     * 获取年度所有指导单号
     *
     * @param createdAtFrom
     * @param createdAtTo
     * @return List
     */
    List getGuidNumsByYear(String createdAtFrom, String createdAtTo);

    /**
     * 根据id删除信息 on 2019-11-12 15:00:45
     *
     * @param id id
     * @return int
     */
    int deleteById(Long id);

    /**
     * 根据id集合批量删除信息 on 2019-11-12 15:00:45
     *
     * @param ids ids
     * @return int
     */
    int deleteByIds(List<Long> ids);


    /**
     * 插入 on 2019-11-12 15:00:45
     *
     * @param businessInspect businessInspect
     * @return int
     */
    int insert(BusinessInspect businessInspect);

    /**
     * 更新 on 2019-11-12 15:00:45
     *
     * @param businessInspect businessInspect
     * @return int
     */
    int update(BusinessInspect businessInspect);

    List<JSONObject> findRecycle(QueryRecycleRequest request);

    int restore(List<Long> ids);

    List<InspectEfficiencyPoint> getAvgMarkOfYearsOfInstructor(Long instructorId, Year year);

    List<InspectEfficiencyPoint> getSelfOrRepeatAvgMarkOfYearsOfInstructor(Long instructorId, Year year);

    List<EfficiencyOfGuidanceAndMendOfPoint> getEfficiencyOfGuianceAndMend(Year year);

    List<EfficiencyOfGuidanceAndMendOfPoint> getSelfOrRepeatEfficiencyOfGuianceAndMend(Year year);

    List<MarkLostResponse> getMarkLostRanking(Year year, String guidNum);

    List<UnitMarkResponse> getUnitMarkReanking(Year year);

    List<GuidanceVariation> getGuidanceVariationOfYear();

    /**
     * 获取当前指导人已上报条数
     *
     * @param userId userId
     * @return int
     */
    String getRecorderMount(Long userId);
}
